package kr.hkit.powerjava.chapter08;

class Test {
	int x;
	int y;
	
	void printTest(int x, int y){
		this.x =x;
		this.y =y;
		System.out.println(x+y);
	}

	void swap(int x, int y) {
		int temp = x;
		x = y;
		y = temp;
		System.out.println("x의 값 : "+x+ " y의 값 : "+y);
	}
	static void swap(Test t1, Test t2) {
		Test temp = t1;
		t1 = t2;
		t2 = temp;
	}
}

public class TestMain{
	public static void main(String[] args) {
		int a=1;
		int b=2;
/*		Test t = new Test();
		t.printTest(1, 2);
		t.swap(1, 2);												*/
		
		int temp = a;
		a = b;
		b = temp;
		System.out.println("a의 값 : "+a+ " b의 값 : "+b);	
/*																		*/
		
		Test t1 = new Test();
		Test t2 = new Test();
		
		t1 = t2;
		System.out.println(t1);
		System.out.println(t2);
		
		t1.printTest(2,1);
		t2.printTest(3,2);
		
		
/*		swap(t1, t2);*/
	}
}
